#coding:utf-8

from weixin_post import wx_post
from apscheduler.schedulers.blocking import BlockingScheduler
import cx_Oracle
import datetime  
  
# Start the scheduler  
sched = BlockingScheduler()  

def OraRunPrc(v_prc):
    con = cx_Oracle.connect("xxxxxx/xxxxxx$@cd")
    cursor = con.cursor()
    query1 = cursor.callproc(v_prc)
    cursor.close()
    con.close()
    return None  
  
def job_function():  
    wx_post('开始自动执行存储过程')
#    OraRunPrc('ygl_week_job')
    wx_post('完成自动执行存储过程')
    print "Hello World"  , 'start job1 at: ', datetime.datetime.now()
 


print datetime.datetime.now()
sched.daemonic = False  

sched.add_job(job_function, 'cron', day_of_week='2', hour='9', minute='1',second='1')  

sched.start()  

